package com.management.department.teacherinfosystem.Repository;

import com.management.department.teacherinfosystem.Entity.AcademicSemesterConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AcademicSemesterConfigRepository extends JpaRepository<AcademicSemesterConfig, Long> {
    
    // 查询所有激活的学年学期，按排序顺序排列
    List<AcademicSemesterConfig> findByIsActiveTrueOrderBySortOrderAsc();
    
    // 根据学年学期名称查询
    AcademicSemesterConfig findByAcademicYear(String academicYear);
    
    // 查询所有学年学期，按排序顺序排列
    List<AcademicSemesterConfig> findAllByOrderBySortOrderAsc();
}
